  <div class="content col-xs-12 col-sm-10">
            <div class="banner">
              <p class="fl">用户管理 > 添加用户</p>
            </div>
          
            <div class="infoBox">
              <div class="info">
          <?php echo validation_errors(); ?>

        <?php echo form_open('user/add'); ?>
            <input type="hidden" name="parentId" value=<?php echo $_SESSION['userId']; ?> >
                        
                 <div class="line">
                            <label>姓名:</label>
                            <input type="text" name="name" value="真实姓名" onFocus="if(value==defaultValue){value='';this.style.color='#000'}" onBlur="if(!value){value=defaultValue;this.style.color='#999'}">
                        </div>
                            <input type="hidden" name="level" value="2">
                     
                        <div class="line">
                            <label>密码:</label>
                            <input type="password" name="password" value="" id="password2" class="text_login">
                            <input type="text" value="8~16位字母或数字组合" class="text_login" id="password1" class="text_login"/> 
                        </div>     
                        <div class="line">
                            <label>手机号码:</label>
                            <input type="text" name="mobile" value="" onFocus="if(value==defaultValue){value='';this.style.color='#000'}" onBlur="if(!value){value=defaultValue;this.style.color='#999'}">
                        </div>
                        <div class="lastLine">
                          <input type="submit" value="添加" class="add"/>
                          <!-- <input type="button" value="" class="cancel fr"/> -->

                      </div>  
                 </form> 
                </div>

            </div>
          
        </div>
      </div>
    </div>

<script>
      var defaultValue = $("#password1").val();
      $(".text_login").focus(function(){  
                if($(this).val()=='user name' || $(this).val()==defaultValue){  
                    $(this).val('');  
                }  
                if($(this).attr('id')=='password1'){  
                    $(this).hide();  
                    $('#password2').show();  
                    $('#password2').focus();  
                }  
            });  
            $(".text_login").blur(function(){  
                if($(this).attr('id')=='password2' && $(this).val()==''){  
                    $(this).hide();  
                    $('#password1').show();  
                    $('#password1').val(defaultValue);  
                }  
                else if($(this).attr('id')=='uname' && $(this).val()=='' ){  
                    $(this).val('user name');  
                }  
            });  
    </script>